markdown-it-chain
A chaining API like webpack-chain but for markdown-it.
Install
Yarn
yarn add -dev markdown-it-chain
npm
npm install --save-dev markdown-it-chain
Getting Started
const Config = require('markdown-it-chain')
const config = new Config()
config
.options
.html(true)
.linkify(true)
.end()
.plugin('toc')
.use(require('markdown-it-table-of-contents'), [{
includeLevel: [2, 3]
}])
.end()
.plugin('anchor')
.use(require('markdown-it-anchor'), [{
permalink: true,
permalinkBefore: true,
permalinkSymbol: '$'
}])
.before('toc')
const md = config.toMd()
md.render('[[TOC]] \n # h1 \n ## h2 \n ## h3 ')
Worth Reading
In order to ensure the consistency of the chained API world, webpack-it-chain
is developed directly on the basis of webpack-chain and ensures that the usage is completely consistent.
Here are some things worth reading that come from webpack-chain
:
Author
markdown-it-chain © ULIVZ, Released under the MIT License.
Authored and maintained by ULIVZ with help from contributors (list).
github.com/ulivz · GitHub @ULIVZ · Twitter @_ulivz